package cn.kgm.orderStatus.impl;

import cn.kgm.orderStatus.AstractOrderState;
import cn.kgm.orderStatus.Order;
import cn.kgm.orderStatus.OrderState;

public class NotSubmitted extends AstractOrderState {

    public NotSubmitted(Order order) {
        super(order);
    }

    @Override
    public OrderState submit() {
        System.out.println("当前状态：" + this.getOrder().getStatus() + " 已提交");
        // 订单提交代码
        return new Submitted(this.getOrder());
    }

    @Override
    public OrderState cancel() {
        System.out.println("当前状态：" + this.getOrder().getStatus());
        // 订单提交代码
        return new Cancelled(this.getOrder());
    }
}
